<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableSystemConfig extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_config', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title',30)->default('')->comment('标题');
            $table->string('type',30)->default('input')->comment('类型');
            $table->string('pcre')->default('')->comment('正则表达式');
            $table->unsignedInteger('sort')->default(10)->comment('排序');
            $table->string('special_show')->default('')->comment('特殊字符');
            $table->tinyInteger('is_disabled')->default(-1)->comment('1禁用，-1非禁用');
            $table->string('unique_code',30)->default('')->unique()->comment('唯一标识 key');
            $table->string('value')->default('')->comment('值');
            $table->string('group',50)->default('')->comment('组别');
            $table->text('content')->nullable()->comment('内容');
            $table->dateTime('created_at')->nullable()->comment('创建日期');
            $table->dateTime('updated_at')->nullable()->comment('更新日期');
            $table->dateTime('deleted_at')->nullable()->comment('删除日期');
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `system_config` COMMENT='系统配置'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_config');
    }
}
